how to determine the distance